**Only necessary if your Hier Menu has command-key equivalents
Description
-----------
Although Prograph's menu editor does not directly support the creation of hierarchical menus, this set of classes and methods makes it easy to add them to your application by following a simple naming convention for the submenu.
How To Use In Your Program
--------------------------
The Hier Menu class has been designed for ease of use. There are,
however, a few simple rules to follow when using it.
Creating and Editing Hierarchical Menus
You can create and edit a hierarchical menu just like any other menu.
Simply be sure that you actually create an instance of Hier Menu
( conversely, do not use the Hier Menu class for non-hierarchical menus).
In order to specify where a hierarchical menu is to appear in your
application, follow this simple convention. The name of your hierarchical
menu should consist of the name of the menu it is to appear in, and the
name of the item it will be attached to, separated by a special separator
character ( '^' by default. you can change this in the Hier Menu class if
necessary ).
You should not add your hierarchical menus to the active list. They should
reside only in the Menu Library of your application.
Installing your Hierarchical Menus
The Init routine does all the installation of your hierarchical menus. It
searches the Menu Lib for all instances of Hier Menu, parses the names to
determine where to install them and does the actual installation. During
the installation process, your hierarchical menus will be added to the
active menu list, and their names will be set to the empty string. You will
notice this if you enter the menu editor while your application is running.
Do not remove hierarchical menus from the active menu list. The Cleanup
routine will do this for you. Because the Prograph interpreter allows you
to switch context during execution, the Update routine is necessary to
ensure that your hierarchical menus are always available. It does not
need to be called in your compiled code. The example shows how to use
the compiled? primitive to call Update when necessary.
The Key Method
The Human Interface Guidelines recommend that you not put command-key
equivalents on hierarchical menu items. If you wish to do so, however,
you must call the Key method in place of the sc-key-menu primitive. Note,
however, that doing so will disable Prograph's special command key
feature (ie option/shift/control keys in your command keys ) for your